
(function($) {
  $(function(){
      $('#shoplist').removeClass('dn');
      var vm = new Vue({
        el: '#shoplist',
        data: function() {
          return {
            shopList: []
          }      
        },
        created: function() {
          var _this = this
          var access_token = localStorage.getItem('access_token')
          $.mAjax({
            url: '/shop/get-shop-list-by-owner',
            data: {},
            success: function (res) {
              if (res.status == 1) {
                _this.shopList = res.data
              } else {
                if (res.error.errorno == '401') {
                  layer.open({
                    content: '登录过期，请重新登录！',
                    skin: 'msg',
                    time: 2 //2秒后自动关闭
                  })
                  setTimeout(function () {
                    localStorage.removeItem('_u_info_')
                    location.href = './index.html'
                  }, 2000)
                }
              }
            }
          })   
        },
        methods: {
          getShopHref: function (val) {
            return '../my-shop.html?shop_id=' + val
          }
        }
      })
  })    
})(jQuery)